from flask import Blueprint, render_template
from .scratch_exercises import scratch_exercises_bp

exercises_bp = Blueprint('exercises', __name__, url_prefix='/exercises')

# 注册 scratch_exercises 蓝图
# 确保完整的URL路径为 /exercises/scratch/...
exercises_bp.register_blueprint(scratch_exercises_bp, url_prefix='/scratch')

@exercises_bp.route('/')
def index():
    return render_template('frontend/online_exercise.html')

@exercises_bp.route('/python')
def python():
    return render_template('frontend/python_exercise.html')

@exercises_bp.route('/scratch')
def scratch():
    return render_template('frontend/scratch_exercise.html')
